/*
 *    Copyright 2010 Vanessa Williams
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package bioformatica.symbol;

/**
 * Amino acid enum.
 */
public enum AminoAcid {

    /**
     * Alanine
     */
    A("Alanine"),
    /**
     * Arginine
     */
    R("Arginine"),
    /**
     * Asparagine
     */
    N("Asparagine"),
    /**
     * Aspartic acid
     */
    D("Aspartic acid"),
    /**
     * Cysteine
     */
    C("Cysteine"),
    /**
     * Glutamine
     */
    Q("Glutamine"),
    /**
     * Glutamic acid
     */
    E("Glutamic acid"),
    /**
     * Glycine
     */
    G("Glycine"),
    /**
     * Histidine
     */
    H("Histidine"),
    /**
     * Isoleucine
     */
    I("Isoleucine"),
    /**
     * Leucine
     */
    L("Leucine"),
    /**
     * Lysine
     */
    K("Lysine"),
    /**
     * Methionine
     */
    M("Methionine"),
    /**
     * Phenylalanine
     */
    F("Phenylalanine"),
    /**
     * Proline
     */
    P("Proline"),
    /**
     * Serine
     */
    S("Serine"),
    /**
     * Threonine
     */
    T("Threonine"),
    /**
     * Tryptophan
     */
    W("Tryptophan"),
    /**
     * Tyrosine
     */
    Y("Tyrosine"),
    /**
     * Valine
     */
    V("Valine")
    ;

    private String acidName;
    private char c;
    private byte b;

    /**
     * Constructor
     * @param name name of acid, e.g. Alanine
     */
    AminoAcid(String name) {
        this.acidName = name;
        this.c = this.name().toCharArray()[0];
        this.b = this.name().getBytes()[0];
    }

    /**
     *
     * @return Standard symbol for amino acid, e.g. 'A' for Alanine
     */
    public char getChar() {
        return c;
    }

    /**
     *
     * @return Standard symbol as a byte
     */
    public byte getByte() {
        return b;
    }

    /**
     *
     * @return name of amino acid e.g. Alanine
     */
    public String getName() {
        return this.acidName;
    }
}
